# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Dale Blount <dale@archlinux.org>

pkgname=perl-sys-hostname-long
_realname=Sys-Hostname-Long
pkgver=1.5
pkgrel=10
pkgdesc="Perl module getting a full hostname"
arch=('any')
license=('PerlArtistic')
url="https://search.cpan.org/dist/${_realname}/"
depends=('perl')
checkdepends=('inetutils')
options=('!emptydirs')
source=(https://search.cpan.org/CPAN/authors/id/S/SC/SCOTT/${_realname}-${pkgver}.tar.gz)
sha256sums=('e9186df3706a877efd6149f2c711d6cf87dd6cf72f6ab935ba8121b225b265cb')

build() {
  cd "${srcdir}/${_realname}-${pkgver}"
  # install module in vendor directories.
  PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd "${srcdir}/${_realname}-${pkgver}"
  make test
}

package() {
  cd "${srcdir}/${_realname}-${pkgver}"
  make install DESTDIR="${pkgdir}"
}
